home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / util / misc / ReportPlus.lha / ReportPlus / source / f11.c < prev    next >
C/C++ Source or Header  |  2002-04-15  |  20KB  |  553 lines

  1. #include <exec/types.h>
  2. #include <proto/exec.h>
  3. #include <intuition/intuition.h>
  4. #include <intuition/gadgetclass.h>
  5. #include <proto/intuition.h>
  6. #include <libraries/gadtools.h>
  7. #include <proto/gadtools.h>
  8.  
  9. #define ALL_REACTION_CLASSES
  10. #define ALL_REACTION_MACROS
  11. #include <reaction/reaction.h>
  12. #include <gadgets/texteditor.h>
  13. #include <clib/texteditor_protos.h>
  14. #include <pragmas/texteditor_pragmas.h>
  15.  
  16. #include <ctype.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include "rp.h"
  20.  
  21. IMPORT  struct AminetStruct aminet;
  22. AGLOBAL struct AGDBStruct   agdb;
  23.  
  24. AGLOBAL struct Gadget*      agdb_gadgets[GIDS_11 + 1];
  25.  
  26. // from rp.c
  27. IMPORT Object*              WinObject[FUNCTIONS + 1];
  28. IMPORT SBYTE                page;
  29. IMPORT struct Window*       MainWindowPtr;
  30. IMPORT struct SharedStruct  shared;
  31. IMPORT struct Screen*       ScreenPtr;
  32. IMPORT struct Menu*         MenuPtr;
  33. IMPORT ULONG                offset,
  34.                             signal;
  35. IMPORT TEXT                 IOBuffer[LONGESTFIELD + 1],
  36.                             aslresult[MEDFIELD + 1],
  37.                             string[VLONGFIELD + 1];
  38. IMPORT struct Library*      TextEditorBase;
  39.  
  40. MODULE void updateagdbgadgets(void);
  41. MODULE void readagdbgadgets(void);
  42.  
  43. AGLOBAL void agdb1(void)
  44. {   struct Hook Hook11Struct;
  45.  
  46.     if ((!(aminet.uploader[0])) && readin("S:Report.sender"))
  47.     {   /* # Refer: <last>,<first> (<company> ,phone <phone>)<LF>
  48.            # Path: <email><LF>
  49.            # ReferID: <developer><LF> */
  50.  
  51.         offset = 0;
  52.         parse("# Refer: ");
  53.         parse(",");
  54.         parse(" (");
  55.         parse(" ,phone ");
  56.         parse(")\n# Path: ");
  57.         parse("\n# ReferID: ");
  58.         strcpy(aminet.uploader, string);
  59.     }
  60.  
  61.     /* Create the window object. */
  62.     lockscreen();
  63.     gadtools();
  64.     InitHook(&Hook11Struct, Hook11Func, NULL);
  65.  
  66. if (!(WinObject[11] =
  67. NewObject
  68. (
  69.     WINDOW_GetClass(),                    NULL,
  70.     WA_PubScreen,                         ScreenPtr,
  71.     WA_ScreenTitle,                       "Report+",
  72.     WA_Title,                             "Report+: AGDB Review Editor",
  73.     WA_Activate,                          TRUE,
  74.     WA_DepthGadget,                       TRUE,
  75.     WA_DragBar,                           TRUE,
  76.     WA_CloseGadget,                       TRUE,
  77.     WA_SizeGadget,                        TRUE,
  78.     WA_IDCMP,                             IDCMP_RAWKEY,
  79.     WINDOW_IDCMPHook,                     &Hook11Struct,
  80.     WINDOW_IDCMPHookBits,                 IDCMP_RAWKEY,
  81.     WINDOW_MenuStrip,                     MenuPtr,
  82.     WINDOW_Position,                      WPOS_FULLSCREEN,
  83.     WINDOW_ParentGroup,                   agdb_gadgets[GID_11_LY1] =
  84.     NewObject
  85.     (   LAYOUT_GetClass(),                NULL,
  86.         LAYOUT_Orientation,               LAYOUT_ORIENT_VERT,
  87.         LAYOUT_SpaceOuter,                TRUE,
  88.         LAYOUT_DeferLayout,               TRUE,
  89.         LAYOUT_AddChild,                  NewObject(LAYOUT_GetClass(), NULL,
  90.         LAYOUT_Orientation,               LAYOUT_ORIENT_HORIZ,
  91.         LAYOUT_SpaceOuter,                TRUE,
  92.         LAYOUT_DeferLayout,               TRUE,
  93.         LAYOUT_AddChild,                  NewObject(LAYOUT_GetClass(), NULL,
  94.             LAYOUT_Orientation,           LAYOUT_ORIENT_VERT,
  95.             LAYOUT_SpaceOuter,            TRUE,
  96.             LAYOUT_VertAlignment,         LALIGN_CENTER,
  97.             LAYOUT_BevelStyle,            BVS_NONE,
  98.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  99.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  100.                 LAYOUT_SpaceOuter,        TRUE,
  101.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  102.                 // LALIGN_RIGHT seems not to work, as you can see :-(
  103.                 LAYOUT_BevelStyle,        BVS_FIELD,
  104.                 LAYOUT_AddImage,          NewObject
  105.                 (   LABEL_GetClass(),     NULL,
  106.                     // label
  107.                     LABEL_Text,           "_Title:",
  108.                     LABEL_Justification,  LJ_RIGHT,
  109.                     TAG_END
  110.                 ),
  111.                 TAG_END
  112.             ),
  113.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  114.                 // layout
  115.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  116.                 LAYOUT_SpaceOuter,        TRUE,
  117.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  118.                 LAYOUT_BevelStyle,        BVS_FIELD,
  119.                 LAYOUT_AddImage,          NewObject
  120.                 (   LABEL_GetClass(),     NULL,
  121.                     // label
  122.                     LABEL_Text,           "_Publisher (Year):",
  123.                     LABEL_Justification,  LJ_RIGHT,
  124.                     TAG_END
  125.                 ),
  126.                 TAG_END
  127.             ),
  128.             LAYOUT_AddChild,
  129.             NewObject
  130.             (   LAYOUT_GetClass(),        NULL,
  131.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  132.                 LAYOUT_SpaceOuter,        TRUE,
  133.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  134.                 LAYOUT_BevelStyle,        BVS_FIELD,
  135.                 LAYOUT_AddImage,          NewObject
  136.                 (   LABEL_GetClass(),     NULL,
  137.                     // label
  138.                     LABEL_Text,           "_Game Type:",
  139.                     LABEL_Justification,  LJ_RIGHT,
  140.                     TAG_END
  141.                 ),
  142.                 TAG_END
  143.             ),
  144.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  145.                 // layout
  146.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  147.                 LAYOUT_SpaceOuter,        TRUE,
  148.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  149.                 LAYOUT_BevelStyle,        BVS_FIELD,
  150.                 LAYOUT_AddImage,          NewObject
  151.                 (   LABEL_GetClass(),     NULL,
  152.                     // label
  153.                     LABEL_Text,           "P_layers:",
  154.                     LABEL_Justification,  LJ_RIGHT,
  155.                     TAG_END
  156.                 ),
  157.                 TAG_END
  158.             ),
  159.             LAYOUT_AddChild,
  160.             NewObject
  161.             (   LAYOUT_GetClass(),        NULL,
  162.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  163.                 LAYOUT_SpaceOuter,        TRUE,
  164.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  165.                 LAYOUT_BevelStyle,        BVS_FIELD,
  166.                 LAYOUT_AddImage,          NewObject
  167.                 (   LABEL_GetClass(),     NULL,
  168.                     // label
  169.                     LABEL_Text,           "_Compatibility:",
  170.                     LABEL_Justification,  LJ_RIGHT,
  171.                     TAG_END
  172.                 ),
  173.                 TAG_END
  174.             ),
  175.             LAYOUT_AddChild,
  176.             NewObject
  177.             (   LAYOUT_GetClass(),        NULL,
  178.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  179.                 LAYOUT_SpaceOuter,        TRUE,
  180.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  181.                 LAYOUT_BevelStyle,        BVS_FIELD,
  182.                 LAYOUT_AddImage,          NewObject
  183.                 (   LABEL_GetClass(),     NULL,
  184.                     // label
  185.                     LABEL_Text,           "_HD Installable?",
  186.                     LABEL_Justification,  LJ_RIGHT,
  187.                     TAG_END
  188.                 ),
  189.                 TAG_END
  190.             ),
  191.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  192.                 // layout
  193.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  194.                 LAYOUT_SpaceOuter,        TRUE,
  195.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  196.                 LAYOUT_BevelStyle,        BVS_FIELD,
  197.                 LAYOUT_AddImage,          NewObject
  198.                 (   LABEL_GetClass(),     NULL,
  199.                     // label
  200.                     LABEL_Text,           "_Submission:",
  201.                     LABEL_Justification,  LJ_RIGHT,
  202.                     TAG_END
  203.                 ),
  204.                 CHILD_WeightedWidth,      0,
  205.                 TAG_END
  206.             ),
  207.             TAG_END
  208.         ),
  209.         CHILD_WeightedHeight,             0,
  210.         CHILD_WeightedWidth,              0,
  211.         LAYOUT_AddChild,
  212.         NewObject
  213.         (   LAYOUT_GetClass(),            NULL,
  214.             LAYOUT_Orientation,   LAYOUT_ORIENT_VERT,
  215.             LAYOUT_SpaceOuter,    TRUE,
  216.             LAYOUT_VertAlignment, LALIGN_CENTER,
  217.             LAYOUT_HorizAlignment,LALIGN_CENTER,
  218.             LAYOUT_BevelStyle,    BVS_FIELD,
  219.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST1] =
  220.                                   NewObject(STRING_GetClass(), NULL,
  221.             // string        
  222.                 GA_ID,                GID_11_ST1,
  223.                 STRINGA_TextVal,      agdb.title,
  224.                 STRINGA_MinVisible,   20,
  225.             TAG_END),
  226.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST2] =
  227.                                   NewObject(STRING_GetClass(), NULL,
  228.                 // string        
  229.                 GA_ID,                GID_11_ST2,
  230.                 STRINGA_TextVal,      agdb.publisher,
  231.                 STRINGA_MinVisible,   20,
  232.             TAG_END),
  233.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST3] =
  234.                                   NewObject(STRING_GetClass(), NULL,
  235.                 // string        
  236.                 GA_ID,                GID_11_ST3,
  237.                 STRINGA_TextVal,      agdb.gametype,
  238.                 STRINGA_MinVisible,   20,
  239.             TAG_END),
  240.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST4] =
  241.                                   NewObject(STRING_GetClass(), NULL,
  242.                 // string        
  243.                 GA_ID,                GID_11_ST4,
  244.                 STRINGA_TextVal,      agdb.players,
  245.                 STRINGA_MinVisible,   20,
  246.             TAG_END),
  247.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST5] =
  248.                                   NewObject(STRING_GetClass(), NULL,
  249.                 // string        
  250.                 GA_ID,                GID_11_ST5,
  251.                 STRINGA_TextVal,      agdb.hdinstallable,
  252.                 STRINGA_MinVisible,   20,
  253.             TAG_END),
  254.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST6] =
  255.                                   NewObject(STRING_GetClass(), NULL,
  256.                 // string        
  257.                 GA_ID,                GID_11_ST6,
  258.                 STRINGA_TextVal,      agdb.compatibility,
  259.                 STRINGA_MinVisible,   20,
  260.             TAG_END),
  261.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST7] =
  262.                                   NewObject(STRING_GetClass(), NULL,
  263.                 // string        
  264.                 GA_ID,                GID_11_ST7,
  265.                 STRINGA_TextVal,      aminet.uploader,
  266.                 STRINGA_MinVisible,   20,
  267.             TAG_END),
  268.             CHILD_WeightedHeight,     0,
  269.             TAG_END
  270.         ),
  271.         CHILD_WeightedHeight,     0,
  272.         TAG_END
  273.     ),
  274.     CHILD_WeightedHeight,         0,
  275.         LAYOUT_AddChild,          NewObject(LAYOUT_GetClass(), NULL,
  276.             // layout
  277.             LAYOUT_Orientation,   LAYOUT_ORIENT_HORIZ,
  278.             LAYOUT_SpaceOuter,    TRUE,
  279.             LAYOUT_HorizAlignment,LALIGN_CENTER,
  280.             LAYOUT_BevelStyle,    BVS_FIELD,
  281.             LAYOUT_AddImage,          NewObject
  282.             (   LABEL_GetClass(),     NULL,
  283.                 // label
  284.                 LABEL_Text,           "_Review:",
  285.                 LABEL_Justification,  LJ_CENTER,
  286.                 TAG_END
  287.             ),
  288.             TAG_END
  289.         ),
  290.         CHILD_WeightedHeight,     0,
  291.         LAYOUT_AddChild,          agdb_gadgets[GID_11_TE1] =
  292.                                   (struct Gadget *) NewObject
  293.         (   TEXTEDITOR_GetClass(),    NULL,
  294.             GA_ID,                    GID_11_TE1,
  295.             GA_RelVerify,             TRUE,
  296.             GA_TEXTEDITOR_ExportWrap,  75,
  297.             TAG_END
  298.         ),
  299.         TAG_END
  300.     ),
  301.     TAG_END
  302. )))
  303. {   rq("Can't create ReAction gadgets!");
  304. }
  305. unlockscreen();
  306. openwindow();
  307.  
  308.     SetGadgetAttrs
  309.     (   agdb_gadgets[GID_11_TE1],    MainWindowPtr, NULL,
  310.         GA_TEXTEDITOR_Contents, agdb.textfield
  311.     ); // long description
  312.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_NEW,    NOSUB));
  313.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_OPEN,   NOSUB));
  314.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_SAVE,   NOSUB));
  315.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_SAVEAS, NOSUB));
  316.  
  317.     ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST1]);
  318.     loop();
  319.     readagdbgadgets();
  320.     closewindow();
  321. }
  322.  
  323. AGLOBAL void saveagdb(ABOOL saveas)
  324. {   /*  Title            <title>
  325.         Publisher        <publisher>
  326.         Game Type        <game type>
  327.         Players          <players>
  328.         HD Installable   <hd installable>
  329.         Compatibility    <compatibility>
  330.         Submission       <uploader>
  331.         
  332.         Review
  333.         <review> */
  334.  
  335.     readagdbgadgets();
  336.  
  337.     strcpy(IOBuffer, "Title:           ");
  338.     strcat(IOBuffer, agdb.title);
  339.     strcat(IOBuffer, "\nPublisher:       ");
  340.     strcat(IOBuffer, agdb.publisher);
  341.     strcat(IOBuffer, "\nGame Type:       ");
  342.     strcat(IOBuffer, agdb.gametype);
  343.     strcat(IOBuffer, "\nPlayers:         ");
  344.     strcat(IOBuffer, agdb.players);
  345.     strcat(IOBuffer, "\nHD Installable:  ");
  346.     strcat(IOBuffer, agdb.hdinstallable);
  347.     strcat(IOBuffer, "\nCompatibility:   ");
  348.     strcat(IOBuffer, agdb.compatibility);
  349.     strcat(IOBuffer, "\nSubmission:      ");
  350.     strcat(IOBuffer, aminet.uploader);
  351.     strcat(IOBuffer, "\n\nReview:\n");
  352.     strcat(IOBuffer, agdb.textfield);
  353.  
  354.     if (!agdb.output[0] || saveas) // if we need a filename
  355.     {   if (saveasl("Save AGDB Review", "~(#?.info)"))
  356.         {   strcpy(agdb.output, aslresult);
  357.             writeout(agdb.output);
  358.     }   }
  359.     else
  360.     {   writeout(agdb.output);
  361. }   }
  362.  
  363. AGLOBAL void agdb_loop(ULONG gid)
  364. {   ; // :-)
  365. }
  366.  
  367. AGLOBAL ULONG Hook11Func(struct Hook *h, VOID *o, VOID *msg)
  368. {   /* "When the hook is called, the data argument points to the 
  369.     window object and message argument to the IntuiMessage." */
  370.  
  371.     UWORD code, qual;
  372.  
  373.     geta4(); // wait till here before doing anything
  374.  
  375.     code = ((struct IntuiMessage *) msg)->Code;
  376.     qual = ((struct IntuiMessage *) msg)->Qualifier;
  377.  
  378.     switch(code)
  379.     {
  380.     case SCAN_HELP:
  381.         helpabout();
  382.     break;
  383.     case SCAN_ESCAPE:
  384.         if ((qual & IEQUALIFIER_LSHIFT) || (qual & IEQUALIFIER_RSHIFT))
  385.         {   cleanexit(EXIT_SUCCESS);
  386.         } else page = 0;
  387.     break;
  388.     case SCAN_T:
  389.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST1]);
  390.     break;
  391.     case SCAN_P:
  392.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST2]);
  393.     break;
  394.     case SCAN_G:
  395.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST3]);
  396.     break;
  397.     case SCAN_L:
  398.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST4]);
  399.     break;
  400.     case SCAN_C:
  401.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST5]);
  402.     break;
  403.     case SCAN_H:
  404.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST6]);
  405.     break;
  406.     case SCAN_S:
  407.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST7]);
  408.     break;
  409.     case SCAN_R:
  410.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_TE1]);
  411.     break;
  412.     default:
  413.     break;
  414.     }
  415.  
  416.     return(1);
  417. }
  418.  
  419. AGLOBAL void newagdb(ABOOL display)
  420. {   strcpy(agdb.title,         "");
  421.     strcpy(agdb.publisher,     "");
  422.     strcpy(agdb.gametype,      "");
  423.     strcpy(agdb.players,       "");
  424.     strcpy(agdb.hdinstallable, "");
  425.     strcpy(agdb.compatibility, "");
  426.     strcpy(aminet.uploader,    "");
  427.     strcpy(agdb.output,        "");
  428.     strcpy(agdb.textfield,     "");
  429.  
  430.     if (display)
  431.         updateagdbgadgets();
  432. }
  433.  
  434. AGLOBAL void openagdb(void)
  435. {   if (asl("~(#?.info)"))
  436.     {   strcpy(agdb.output, aslresult);
  437.         loadagdb();
  438.         updateagdbgadgets();
  439. }   }
  440.  
  441. AGLOBAL void loadagdb(void)
  442. {   if (readin(agdb.output))
  443.     {   offset = 0;
  444.  
  445.         parse("Title:           ");
  446.         parse("\nPublisher:       ");
  447.         strcpy(agdb.title,         string);
  448.         parse("\nGame Type:       ");
  449.         strcpy(agdb.publisher,     string);
  450.         parse("\nPlayers:         ");
  451.         strcpy(agdb.gametype,      string);
  452.         parse("\nHD Installable:  ");
  453.         strcpy(agdb.players,       string);
  454.         parse("\nCompatibility:   ");
  455.         strcpy(agdb.hdinstallable, string);
  456.         parse("\nSubmission:      ");
  457.         strcpy(agdb.compatibility, string);
  458.         parse("\n\nReview:\n");
  459.         strcpy(aminet.uploader,    string);
  460.         parsetoend();
  461.         strcpy(agdb.textfield,     string);
  462.  
  463.         updateagdbgadgets();
  464. }   }
  465.  
  466. MODULE void updateagdbgadgets(void)
  467. {   SetGadgetAttrs
  468.     (   agdb_gadgets[GID_11_ST1], MainWindowPtr, NULL,
  469.         STRINGA_TextVal, agdb.title,
  470.         TAG_DONE
  471.     );
  472.     SetGadgetAttrs
  473.     (   agdb_gadgets[GID_11_ST2], MainWindowPtr, NULL,
  474.         STRINGA_TextVal, agdb.publisher,
  475.         TAG_DONE
  476.     );
  477.     SetGadgetAttrs
  478.     (   agdb_gadgets[GID_11_ST3], MainWindowPtr, NULL,
  479.         STRINGA_TextVal, agdb.gametype,
  480.         TAG_DONE
  481.     );
  482.     SetGadgetAttrs
  483.     (   agdb_gadgets[GID_11_ST4], MainWindowPtr, NULL,
  484.         STRINGA_TextVal, agdb.players,
  485.         TAG_DONE
  486.     );
  487.     SetGadgetAttrs
  488.     (   agdb_gadgets[GID_11_ST5], MainWindowPtr, NULL,
  489.         STRINGA_TextVal, agdb.hdinstallable,
  490.         TAG_DONE
  491.     );
  492.     SetGadgetAttrs
  493.     (   agdb_gadgets[GID_11_ST6], MainWindowPtr, NULL,
  494.         STRINGA_TextVal, agdb.compatibility,
  495.         TAG_DONE
  496.     );
  497.     SetGadgetAttrs
  498.     (   agdb_gadgets[GID_11_ST7], MainWindowPtr, NULL,
  499.         STRINGA_TextVal, aminet.uploader,
  500.         TAG_DONE
  501.     );
  502.     SetGadgetAttrs
  503.     (   agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL,
  504.         GA_TEXTEDITOR_Contents, aminet.textfield,
  505.         TAG_DONE
  506.     );
  507. }
  508.  
  509. MODULE void readagdbgadgets(void)
  510. {   STRPTR textBuffer;
  511.  
  512.     if (!(GetAttr
  513.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST1], (ULONG *) agdb.title
  514.     )))
  515.     {   rq("Unsupported inquiry!"); // should never happen
  516.     }
  517.     if (!(GetAttr
  518.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST2], (ULONG *) agdb.publisher
  519.     )))
  520.     {   rq("Unsupported inquiry!"); // should never happen
  521.     }
  522.     if (!(GetAttr
  523.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST3], (ULONG *) agdb.gametype
  524.     )))
  525.     {   rq("Unsupported inquiry!"); // should never happen
  526.     }
  527.     if (!(GetAttr
  528.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST4], (ULONG *) agdb.players
  529.     )))
  530.     {   rq("Unsupported inquiry!"); // should never happen
  531.     }
  532.     if (!(GetAttr
  533.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST5], (ULONG *) agdb.hdinstallable
  534.     )))
  535.     {   rq("Unsupported inquiry!"); // should never happen
  536.     }
  537.     if (!(GetAttr                              
  538.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST6], (ULONG *) agdb.compatibility
  539.     )))
  540.     {   rq("Unsupported inquiry!"); // should never happen
  541.     }
  542.     if (!(GetAttr
  543.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST7], (ULONG *) aminet.uploader
  544.     )))
  545.     {   rq("Unsupported inquiry!"); // should never happen
  546.     }
  547.  
  548.     textBuffer = (STRPTR) DoGadgetMethod(agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL, GM_TEXTEDITOR_ExportText, NULL);
  549.     strcpy(agdb.textfield, textBuffer); // long description
  550.     FreeVec((APTR) textBuffer);
  551.     // textBuffer = NULL;
  552. }
  553.